.class public Lcom/instagram/android/p/a;
.super Ljava/lang/Object;
.source "RealtimeConnectionDebugNotification.java"


# static fields
.field private static final a:Ljava/lang/String;


# instance fields
.field private final b:Landroid/content/Context;

.field private final c:Landroid/app/NotificationManager;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 41
    const-class v0, Lcom/instagram/android/p/a;

    invoke-virtual {v0}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;

    move-result-object v0

    sput-object v0, Lcom/instagram/android/p/a;->a:Ljava/lang/String;

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;)V
    .locals 3
    .parameter

    .prologue
    .line 47
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 48
    iput-object p1, p0, Lcom/instagram/android/p/a;->b:Landroid/content/Context;

    .line 49
    iget-object v0, p0, Lcom/instagram/android/p/a;->b:Landroid/content/Context;

    const-string v1, "notification"

    invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/app/NotificationManager;

    iput-object v0, p0, Lcom/instagram/android/p/a;->c:Landroid/app/NotificationManager;

    .line 54
    invoke-static {}, Lcom/instagram/i/a;->b()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 55
    new-instance v0, Lcom/instagram/android/p/c;

    const/4 v1, 0x0

    invoke-direct {v0, p0, v1}, Lcom/instagram/android/p/c;-><init>(Lcom/instagram/android/p/a;Lcom/instagram/android/p/b;)V

    .line 57
    new-instance v1, Lcom/facebook/b/a/k;

    invoke-direct {v1, p1}, Lcom/facebook/b/a/k;-><init>(Landroid/content/Context;)V

    .line 58
    invoke-virtual {v1}, Lcom/facebook/b/a/k;->a()Lcom/facebook/b/a/i;

    move-result-object v1

    const-string v2, "PreferenceChangeBroadcasts.REALTIME_CONNECTION_NOTIFICATION_PREF_CHANGED"

    invoke-interface {v1, v2, v0}, Lcom/facebook/b/a/i;->a(Ljava/lang/String;Lcom/facebook/d/a;)Lcom/facebook/b/a/i;

    move-result-object v0

    invoke-interface {v0}, Lcom/facebook/b/a/i;->a()Lcom/facebook/b/a/j;

    move-result-object v0

    .line 65
    invoke-interface {v0}, Lcom/facebook/b/a/j;->b()V

    .line 67
    :cond_0
    return-void
.end method

.method static synthetic a(Lcom/instagram/android/p/a;)Landroid/app/NotificationManager;
    .locals 1
    .parameter

    .prologue
    .line 21
    iget-object v0, p0, Lcom/instagram/android/p/a;->c:Landroid/app/NotificationManager;

    return-object v0
.end method

.method static synthetic a()Ljava/lang/String;
    .locals 1

    .prologue
    .line 21
    sget-object v0, Lcom/instagram/android/p/a;->a:Ljava/lang/String;

    return-object v0
.end method

.method private a(ILjava/lang/String;Z)V
    .locals 4
    .parameter
    .parameter
    .parameter

    .prologue
    const/4 v3, 0x0

    .line 100
    new-instance v0, Landroid/support/v4/app/at;

    iget-object v1, p0, Lcom/instagram/android/p/a;->b:Landroid/content/Context;

    invoke-direct {v0, v1}, Landroid/support/v4/app/at;-><init>(Landroid/content/Context;)V

    invoke-virtual {v0, p1}, Landroid/support/v4/app/at;->a(I)Landroid/support/v4/app/at;

    move-result-object v0

    iget-object v1, p0, Lcom/instagram/android/p/a;->b:Landroid/content/Context;

    new-instance v2, Landroid/content/Intent;

    invoke-direct {v2}, Landroid/content/Intent;-><init>()V

    invoke-static {v1, v3, v2, v3}, Landroid/app/PendingIntent;->getActivity(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/support/v4/app/at;->a(Landroid/app/PendingIntent;)Landroid/support/v4/app/at;

    move-result-object v0

    const-string v1, "Instagram Debug"

    invoke-virtual {v0, v1}, Landroid/support/v4/app/at;->a(Ljava/lang/CharSequence;)Landroid/support/v4/app/at;

    move-result-object v0

    invoke-virtual {v0, p2}, Landroid/support/v4/app/at;->b(Ljava/lang/CharSequence;)Landroid/support/v4/app/at;

    move-result-object v0

    invoke-virtual {v0, p3}, Landroid/support/v4/app/at;->a(Z)Landroid/support/v4/app/at;

    move-result-object v0

    .line 109
    iget-object v1, p0, Lcom/instagram/android/p/a;->c:Landroid/app/NotificationManager;

    sget-object v2, Lcom/instagram/android/p/a;->a:Ljava/lang/String;

    const/16 v3, 0x2a

    invoke-virtual {v0}, Landroid/support/v4/app/at;->a()Landroid/app/Notification;

    move-result-object v0

    invoke-virtual {v1, v2, v3, v0}, Landroid/app/NotificationManager;->notify(Ljava/lang/String;ILandroid/app/Notification;)V

    .line 110
    return-void
.end method

.method static synthetic a(Lcom/instagram/android/p/a;Lcom/instagram/realtimeclient/RealtimeEventHandler$Status;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 21
    invoke-direct {p0, p1}, Lcom/instagram/android/p/a;->b(Lcom/instagram/realtimeclient/RealtimeEventHandler$Status;)V

    return-void
.end method

.method private b(Lcom/instagram/realtimeclient/RealtimeEventHandler$Status;)V
    .locals 3
    .parameter

    .prologue
    const/4 v2, 0x1

    .line 78
    sget-object v0, Lcom/instagram/android/p/b;->a:[I

    invoke-virtual {p1}, Lcom/instagram/realtimeclient/RealtimeEventHandler$Status;->ordinal()I

    move-result v1

    aget v0, v0, v1

    packed-switch v0, :pswitch_data_0

    .line 95
    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string v1, "Unrecognized status"

    invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    .line 97
    :goto_0
    return-void

    .line 80
    :pswitch_0
    sget v0, Lcom/facebook/av;->notification_connected:I

    const-string v1, "Realtime channel connected"

    invoke-direct {p0, v0, v1, v2}, Lcom/instagram/android/p/a;->a(ILjava/lang/String;Z)V

    goto :goto_0

    .line 85
    :pswitch_1
    sget v0, Lcom/facebook/av;->notification_subscribed:I

    const-string v1, "Realtime channel subscribed"

    invoke-direct {p0, v0, v1, v2}, Lcom/instagram/android/p/a;->a(ILjava/lang/String;Z)V

    goto :goto_0

    .line 90
    :pswitch_2
    sget v0, Lcom/facebook/av;->notification_not_connected:I

    const-string v1, "Realtime channel not connected"

    const/4 v2, 0x0

    invoke-direct {p0, v0, v1, v2}, Lcom/instagram/android/p/a;->a(ILjava/lang/String;Z)V

    goto :goto_0

    .line 78
    nop

    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
        :pswitch_1
        :pswitch_2
    .end packed-switch
.end method


# virtual methods
.method public a(Lcom/instagram/realtimeclient/RealtimeEventHandler$Status;)V
    .locals 1
    .parameter

    .prologue
    .line 70
    invoke-static {}, Lcom/instagram/m/a/a;->a()Lcom/instagram/m/a/a;

    move-result-object v0

    invoke-virtual {v0}, Lcom/instagram/m/a/a;->i()Z

    move-result v0

    if-nez v0, :cond_0

    .line 75
    :goto_0
    return-void

    .line 74
    :cond_0
    invoke-direct {p0, p1}, Lcom/instagram/android/p/a;->b(Lcom/instagram/realtimeclient/RealtimeEventHandler$Status;)V

    goto :goto_0
.end method
